package com.jerry.base.io.write;

import org.junit.Test;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 * User: Jerry
 * Date: 2024/1/26
 * Time: 22:03
 * Description:
 */
public class BufferedWriterUsage {

    @Test
    public void read() throws IOException {
        String filePath = "src/main/resources/io/BufferedWriterUsage.txt";

        String text = "我是一个宝宝";

        try (BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filePath, true))) {
            bufferedWriter.write(text);
            bufferedWriter.newLine();
            bufferedWriter.write(102);
        }
    }

}
